home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / BSCRIPTS.CST / 00175_Script_175 < prev    next >
Text File  |  1999-04-25  |  16KB  |  550 lines

  1. -- ⌐ 1998 @radical.media, inc. & Concurrent New Media Group, L.L.C.
  2. -- Developed for Bombardier, Inc.
  3. --
  4. -- All programming developed by: 
  5. -- Robert Fabricant, Valerie Valoueva, Ossi Shaked, 
  6. -- Henry Sauvageot, Chris Howell & Chris Girand
  7. --
  8. -- Use of this code by parties other than @radical.media, inc. or their
  9. --agents 
  10. -- without the express written consent of @radical.media, inc. AND Concurrent 
  11. -- New Media Group, L.L.C. is strictly prohibited.
  12. ------------------------------------------------------
  13.  
  14. on getFile
  15.   set tFileIOName  = "fileio"
  16.   set tFileIO=new(xtra tFileIOName)
  17.   openFile(tFileIO, "stones.txt", 1)
  18.   set tString = readFile(tFileIO)
  19.   closeFile(tFileIO)
  20.   
  21.   put tString into member "baseMileStones"
  22.   
  23. end
  24.  
  25. on writeFile
  26.   set tFileIOName  = "fileio"
  27.   set tFileIO=new(xtra tFileIOName)
  28.   
  29.   put the text of member "baseMilestones" into tString
  30.   createFile(tFileIO, "stones.txt")
  31.   set tStatus = status(tFileIO)
  32.   if error(tFileIO,tStatus) = "File already exists" then
  33.     -- problem creating file ... it exists so delete it
  34.     openFile(tFileIO, "stones.txt", 0)
  35.     delete(tFileIO)
  36.     closeFile(tFileIO) -- just to make sure
  37.     createFile(tFileIO, "stones.txt")
  38.     set tStatus = status(tFileIO)
  39.   end if
  40.   
  41.   if tStatus <> 0 then
  42.     -- problem creating file
  43.     alert("Problem creating the new file: " & "stones.txt")
  44.     abort
  45.   else
  46.     closeFile(tFileIO)
  47.     openFile(tFileIO, "stones.txt", 0)
  48.     writeString(tFileIO, tString)
  49.     closeFile(tFileIO)
  50.   end if
  51. end
  52.  
  53. on StopIndexSystem
  54.   forget window "miles.dir"
  55.   forget window "index.dir"
  56. end
  57.  
  58.  
  59.  
  60. on KeyDown
  61.   
  62.   if the keyCode = 123 then 
  63.     if windowPresent("small.dir") then tell window "small.dir" to keyPrevious
  64.   end if
  65.   
  66.   if the keyCode = 124 then
  67.     if windowPresent("small.dir") then tell window "small.dir" to keyNext
  68.   end if
  69.   
  70.   
  71.   --if the controlDown then
  72.   if the keyCode = 34 then
  73.     LaunchIndex
  74.   end if
  75.   if the keyCode = 46 then
  76.     LaunchMilestone
  77.   end if
  78.   if the keyCode = 1 then
  79.     LaunchSmall
  80.   end if
  81.   if the controlDown then
  82.     if the keyCode = 47 then
  83.       quit
  84.     end if
  85.   end if
  86.   
  87.   PASS
  88. end
  89.  
  90.  
  91.  
  92. on LaunchIndex
  93.   global gCGIndex
  94.   --if gCGIndex <> 1 then
  95.   -- open window "index.dir"  
  96.   set indexWindow to window "index.dir"
  97.   set the title of window "index.dir" to "INDEX"
  98.   set centreH to (the stageRight - the stageLeft)/2 + the stageLeft
  99.   set centreV to (the stageBottom - the stageTop)/2 + the stageTop
  100.   set alertW to 368
  101.   set alertH to 265  
  102.   
  103.   set alertLeft to centreH - alertW/2
  104.   set alertTop to centreV - alertH/2
  105.   
  106.   put the stageleft into hNew
  107.   put the stageTop+191 into vNEw
  108.   put the stageLeft+368 into hBot
  109.   put the stageTop + 456 into vBot
  110.   set alertRect to rect(hNew,vNew,hBot,vBot)
  111.   set alertDrawRect to rect(0,0,alertW,alertH)
  112.   -- This uses the file "alert.d" in the current directory
  113.   
  114.   set the rect of indexWindow to alertRect
  115.   set the drawRect of indexWindow to alertDrawRect  -- may not need this
  116.   
  117.   set the windowType of indexWindow = 4
  118.   open IndexWindow
  119.   set gCGIndex = 1
  120.   FixColors
  121.   --end if
  122. end
  123.  
  124.  
  125.  
  126.  
  127. on LaunchMileStone
  128.   set milesWindow to window "miles.dir"
  129.   set the title of window "miles.dir" to "MILESTONES"
  130.   set centreH to (the stageRight - the stageLeft)/2 + the stageLeft
  131.   set centreV to (the stageBottom - the stageTop)/2 + the stageTop
  132.   set alertW to 272
  133.   set alertH to 295  
  134.   
  135.   set alertLeft to centreH - alertW/2
  136.   set alertTop to centreV - alertH/2
  137.   
  138.   put the stageleft+372 into hNew
  139.   put the stageTop+191 into vNEw
  140.   put hNew + 272 into hBot
  141.   put vNew + 295 into vBot
  142.   set alertRect to rect(hNew,vNew,hBot,vBot)
  143.   set alertDrawRect to rect(0,0,alertW,alertH)
  144.   -- This uses the file "alert.d" in the current directory
  145.   
  146.   set the rect of milesWindow to alertRect
  147.   set the drawRect of milesWindow to alertDrawRect  -- may not need this
  148.   
  149.   set the windowType of milesWindow = 4
  150.   open milesWindow
  151. end 
  152.  
  153.  
  154. on forgetSmall
  155.   global gCGSmall
  156.   put 0 into gCGSmall
  157.   forget window "Small.dir"
  158. end
  159.  
  160.  
  161. on LaunchSmall
  162.   global gCGSmall
  163.   if gCGSmall <> 1 then
  164.     
  165.     
  166.     
  167.     set centreH to (the stageRight - the stageLeft)/2 + the stageLeft
  168.     set centreV to (the stageBottom - the stageTop)/2 + the stageTop
  169.     set alertW to 240  
  170.     set alertH to 26  
  171.     
  172.     set alertLeft to centreH - alertW/2
  173.     set alertTop to centreV - alertH/2
  174.     
  175.     put the stageRight - 240 into hNew
  176.     put the stageTop into vNEw
  177.     put the stageRight into hBot
  178.     put the stageTop + 26 into vBot
  179.     set alertRect to rect(hNew,vNew,hBot,vBot)
  180.     
  181.     set alertDrawRect to rect(0,0,alertW,alertH)
  182.     set alertWindow to window "small.dir"     -- This uses the file "alert.d" in the current directory
  183.     set the windowType of alertWindow to 2
  184.     -- set the modal of alertWindow to true    
  185.     set the rect of alertWindow to alertRect
  186.     set the drawRect of alertWindow to alertDrawRect  -- may not need this
  187.     --  set the visible of the stage to false
  188.     
  189.     
  190.     open alertWindow
  191.     
  192.     
  193.     set gCGSmall = 1
  194.   end if
  195. end
  196.  
  197. on AddMilestone var
  198. --  LaunchMileStone
  199. --  
  200. --  ---put the recently chosen milestone into the stages field.
  201. --  put the text of member "baseMilestones" into bob
  202. --  put bob&RETURN&var into bob
  203. --  put bob into member "baseMilestones"
  204. --  
  205. --  ---change the color of the active Milestones inside the index movie.
  206. --  FixColors
  207. --  
  208. --  ---put the milestone in the milestone MIAW
  209. --  tell window "miles.dir" to addStone var
  210. --  
  211. --  --erase this later:
  212. --  --put "adding milestone "&var into var
  213. --  -- put var into member "words"
  214. --  writeFile
  215. end
  216.  
  217.  
  218. on whatAreMileStones
  219.   put the text of member "baseMilestones" into var
  220.   tell window "miles.dir" to loadUp var
  221. end 
  222.  
  223.  
  224. on updateList sourceVar
  225.   put sourceVar into member "baseMilestones"
  226. end
  227.  
  228. on fixColors
  229.   ---change the color of the active Milestones inside the index movie.
  230.   put the lineCount of member "baseMilestones" into var
  231.   put the text of member "baseMilestones" into BlueMe
  232.   if var > 0 then
  233.     put 1 into n
  234.     repeat while n <= var
  235.       put line n of BlueMe into ActiveString
  236.       tell window "index.dir" to changeColor ActiveString
  237.       put n+1 into n
  238.     end repeat
  239.   end if
  240. end
  241.  
  242. on TakeAway var
  243.   put the text of member "baseMileStones" into sourceVar
  244.   put line var of sourceVar into checkForDoubles
  245.   
  246.   delete line var of member "baseMileStones"
  247.   put the text of member "baseMileStones" into sourceVar
  248.   
  249.   put the lineCount of member "baseMilestones" into theCount
  250.   put 1 into n
  251.   repeat while n <= theCount
  252.     if line n of sourceVar = checkForDoubles then
  253.       put 1 into dontErase
  254.     end if
  255.     put n+1 into n
  256.   end repeat
  257.   
  258.   if voidP(dontErase) then Tell window "index.dir" to TurnBlack checkForDoubles
  259.   
  260.   
  261.   writeFile
  262. end
  263.  
  264.  
  265.  
  266. on HopTo var
  267.   
  268.   if var =  "Business Aircraft Opening Screen" then
  269.     play movie "main.dir"
  270.   else
  271.     if var = "Business Aircraft Main Menu"  then
  272.       play frame "startC" of movie "main.dir"
  273.     else
  274.       global gCurrentStone, gJumpFrame, gSpriteMilestone
  275.       
  276.       put var into gCurrentStone
  277.       put 1 into s
  278.       repeat while s < 10
  279.         put "userNames"&string(s) into myTurn
  280.         put the text of member myTurn into sourceVar
  281.         put the lineCount of member myTurn into theCount
  282.         put 1 into n
  283.         repeat while n <= theCount
  284.           put line n of sourceVar into checkMe
  285.           if checkMe = gCurrentStone then
  286.             put "SpriteDestinations"&string(s) into SpriteTurn
  287.             put "MovieDestinations"&string(s) into MovieTurn
  288.             put the text of member SpriteTurn into SpriteVar
  289.             put the text of member MovieTurn into MovieVar
  290.             put line n of SpriteVar into SpriteVar
  291.             put line 1 of MovieVar into MovieVar
  292.             
  293.             
  294.             
  295.             ---SAME MOVIE
  296.             if the movieName = movieVar then
  297.               
  298.               if char 4 of spriteVar = "" then
  299.                 --main category
  300.                 sendSprite(value(SpriteVar),#mouseUp)
  301.                 sendSprite(value(SpriteVar),#mouseUp)
  302.                 set the  visibility of sprite 1 = 1
  303.                 
  304.               else
  305.                 if char 1 of spriteVar = "1" then
  306.                   --sub category with 3 digit spriteNumber
  307.                   put char 1 to 3 of spriteVar into gSpriteMilestone
  308.                   put length(spriteVar) into theCount
  309.                   put char 4 to theCount of spriteVar into spriteVar
  310.                   put string(spriteVar) into gJumpFrame
  311.                   global gGoBoy
  312.                   put 1 into gGoBoy
  313.                   go to gJumpFrame
  314.                   set the  visibility of sprite 1 = 1
  315.                   
  316.                   
  317.                   exit repeat
  318.                   exit repeat
  319.                   exit repeat
  320.                 else
  321.                   --sub category with 2 digit spriteNumber
  322.                   put char 1 to 2 of spriteVar into gSpriteMilestone
  323.                   put length(spriteVar) into theCount
  324.                   put char 3 to theCount of spriteVar into spriteVar
  325.                   put string(spriteVar) into gJumpFrame
  326.                   global gGoBoy
  327.                   put 1 into gGoBoy
  328.                   go to gJumpFrame
  329.                   set the  visibility of sprite 1 = 1
  330.                   
  331.                   exit repeat
  332.                   exit repeat
  333.                   exit repeat
  334.                 end if
  335.               end if
  336.             end if
  337.             
  338.             ---DIFFERENT MOVIE
  339.             
  340.             if the movieName <> movieVar then
  341.               if the movieName <> "main.dir" then
  342.                 dataBaseThing 93, movieVar
  343.               end if
  344.               
  345.               
  346.               
  347.               if char 4 of spriteVar = "" then
  348.                 --main category listing in a different movie
  349.                 global gSpriteMilestone
  350.                 put value(SpriteVar) into gSpriteMilestone
  351.                 play frame "jumpHere" of movie string(MovieVar)
  352.               else
  353.                 if char 1 of spriteVar = "1" then
  354.                   put char 1 to 3 of spriteVar into gSpriteMilestone
  355.                   put length(spriteVar) into theCount
  356.                   put char 4 to theCount of spriteVar into spriteVar
  357.                   put string(spriteVar) into gJumpFrame
  358.                   play frame "jumpHere" of movie string(MovieVar)
  359.                   --put value(spriteVar) into var3
  360.                   --dataBaseThing var3
  361.                   
  362.                   
  363.                   
  364.                   exit repeat
  365.                   exit repeat
  366.                   exit repeat
  367.                 else
  368.                   put char 1 to 2 of spriteVar into gSpriteMilestone
  369.                   put length(spriteVar) into theCount
  370.                   put char 3 to theCount of spriteVar into spriteVar
  371.                   put string(spriteVar) into gJumpFrame
  372.                   play frame "jumpHere" of movie string(MovieVar)
  373.                   --put value(spriteVar) into var3
  374.                   --dataBaseThing var3
  375.                   
  376.                   exit repeat
  377.                   exit repeat
  378.                   exit repeat
  379.                 end if
  380.                 
  381.               end if
  382.               
  383.             end if
  384.             exit repeat
  385.           else
  386.             put n+1 into n
  387.           end if
  388.         end repeat
  389.         put s+1 into s
  390.       end repeat
  391.     end if
  392.   end if
  393.   ResetTour
  394. end
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401. on SubCategoryFix
  402.   global gGoBoy, gJumpFrame, gSpriteMileStone
  403.   if gGoBoy = 1 then
  404.     set the updateLock = 1
  405.     sendSprite(value(gSpriteMileStone),#mouseUp)
  406.     go to gJumpFrame
  407.     set the updateLock = 0
  408.     put 0 into gGoBoy
  409.     put 0 into gjumpframe
  410.   end if
  411. end
  412.  
  413.  
  414.  
  415. on previousStone
  416.   ResetTour
  417.   CLOSEMOVIE
  418.   global gActualItem, gCurrentStone, gCurrentMS
  419.   
  420.   put the lineCount of member "baseMilestones" into theCount
  421.   put the text of member "baseMilestones" into sourceVar
  422.   
  423.   if voidP(gActualItem) then
  424.     
  425.     put 1 into gActualItem
  426.     
  427.     
  428.     --    put 1 into n
  429.     --    repeat while n <= theCount
  430.     --      put line n of sourceVar into checkVar
  431.     --      if checkVar = gCurrentstone then
  432.     --        put n+1 into gActualItem
  433.     --      end if
  434.     --      put n+1 into n
  435.     --    end repeat
  436.     --    if voidP(gCurrentStone) then 
  437.     --      put 1 into gActualItem
  438.     --    end if
  439.   else
  440.     if gActualItem <> 1 then
  441.       put gActualItem - 1 into gActualItem
  442.     end if
  443.   end if
  444.   
  445.   
  446.   put line gActualItem of sourceVar into gCurrentStone
  447.   
  448.   put gCurrentStone into gCurrentMS
  449.   
  450.   hopTo gCurrentStone
  451.   
  452. end
  453.  
  454.  
  455. on nextStone
  456.   ResetTour
  457.   CLOSEMOVIE
  458.   global gActualItem, gCurrentStone, gCurrentMS
  459.   
  460.   
  461.   put the lineCount of member "baseMilestones" into theCount
  462.   put the text of member "baseMilestones" into sourceVar
  463.   
  464.   if voidP(gActualItem) then 
  465.     put 1 into gActualItem
  466.     
  467.     --    
  468.     --    put 1 into n
  469.     --    repeat while n <= theCount
  470.     --      put line n of sourceVar into checkVar
  471.     --      if checkVar = gCurrentstone then
  472.     --        put n+1 into gActualItem
  473.     --      end if
  474.     --      put n+1 into n
  475.     --    end repeat
  476.     --    if voidP(gCurrentStone) then 
  477.     --      put 1 into gActualItem
  478.     --    end if
  479.     
  480.     
  481.   else
  482.     if gActualItem <> theCount then
  483.       put gActualItem + 1 into gActualItem
  484.     end if
  485.   end if
  486.   
  487.   put line gActualItem of sourceVar into gCurrentStone
  488.   
  489.   put gCurrentStone into gCurrentMS
  490.   hopTo gCurrentStone
  491.   
  492. end
  493.  
  494.  
  495.  
  496.  
  497. on dataBaseThing var, destinationMovie
  498.   if destinationMovie <> "bjs.dir" and destinationMovie <> "bombinc.dir" and destinationMovie <> "cs.dir" then
  499.     --  alert "Chris Howell's handler is being called!"
  500.     
  501.     
  502.     if var > 90 and var < 94 then
  503.       
  504.       
  505.       -- alert "hello"&&destinationMovie
  506.       
  507.       
  508.       initmovieplane destinationMovie
  509.       global currentChartName, cheraseflag, togglestate, compdrawplace
  510.       set compdrawplace = "specs"
  511.       set currentChartName = "ALL"
  512.       set the text of member "disPlane" = "No Competitor"
  513.       set xcastnum = ( the number of member "CHDBaircrafts" ) + 1
  514.       erasedatabasefields(xcastnum)
  515.       set xcastnum = ( the number of member "CHDBconfig" ) + 1
  516.       erasedatabasefields(xcastnum)
  517.       set xcastnum = ( the number of member "CHDBdaircrafts" ) + 1
  518.       erasedatabasefields(xcastnum)
  519.       set xcastnum = ( the number of member "CHDBdconfig" ) + 1
  520.       erasedatabasefields(xcastnum)
  521.       
  522.       
  523.       
  524.       getaircrafts  -- fill competitor popups
  525.       mainspecs
  526.       
  527.     end if
  528.   end if
  529.   
  530. end
  531.  
  532. on initmovieplane destinationmovie
  533.   global CurrentPlane, cheraseflag
  534.   set tCurrentPlane = "Learjet 60"
  535.   if destinationmovie = "Global.dir" then set tCurrentPlane = "Global Express"
  536.   if destinationmovie = "Se.dir" then set tCurrentPlane = "Canadair SE"
  537.   if destinationmovie = "CH604.dir" then set tCurrentPlane = "Challenger 604"
  538.   if destinationmovie = "Lear31a.dir" then set tCurrentPlane = "Learjet 31a"
  539.   if destinationmovie = "Lear45.dir" then set tCurrentPlane = "Learjet 45"
  540.   if destinationmovie = "Lear60.dir" then set tCurrentPlane = "Learjet 60"
  541.   set cheraseflag = TRUE
  542.   set CurrentPlane = tCurrentPlane
  543. end
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.